package com.guozcc.bootweb.util;

import com.guozcc.bootweb.platform.common.DateUtils;
import org.apache.commons.codec.digest.DigestUtils;

import java.io.FileInputStream;
import java.io.IOException;

public class Md5 {

    public static void main(String[] args) throws IOException {
        while (true){
            file2Md5();
        }
    }
    public static void str2Md5() {
        String md5 = DigestUtils.md5Hex("我爱你我的家，我的家，我的天堂".getBytes());
        System.out.println(md5);
        System.out.println(DateUtils.getCurrentDateStr(null));
    }
    public static void file2Md5() throws IOException {
        String md5 = DigestUtils.md5Hex(new FileInputStream("D:\\install\\dataease-offline-installer-v2.1.0.tar.gz"));
        System.out.println(md5);
        System.out.println(DateUtils.getCurrentDateStr(null));
    }
}
